/* 933. 最近的请求次数 */
var RecentCounter = function () {
    this.queue = []
};

/** 
 * @param {number} t
 * @return {number}
 */
RecentCounter.prototype.ping = function (t) {
    this.queue.push(t)
    while (this.queue[0] < t - 3000) {
        this.queue.shift()
    }
    return this.queue.length
};